package audio;

import org.newdawn.slick.SlickException;
import org.newdawn.slick.Sound;

public class SoundFactory {

	private static SoundFactory soundFactory;
	
	public static SoundFactory getInstance() {
		if(soundFactory == null) {
			soundFactory = new SoundFactory();
		}
		return soundFactory;
	}
	
	private SoundFactory(){}
	
	public void playSoundEffect(SoundEffect soundEffect) {
		Sound fx;
		try {
			//fx = new Sound("lib/sound/chunk.wav");
			fx = new Sound(soundEffect.getPath());
			fx.play();
		} catch (SlickException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
}
